<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用户信息列表--待删除')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>用户角色：</p>
                                <input type="text" name="userrole"/>
                            </li>
                            <li>
                                <p>用户名：</p>
                                <input type="text" name="username"/>
                            </li>
                            <li>
                                <p>Email：</p>
                                <input type="text" name="useremail"/>
                            </li>
                            <li>
                                <p>状态：</p>
                                <input type="text" name="userstauts"/>
                            </li>
                            <li>
                                <p>登录次数：</p>
                                <input type="text" name="usercount"/>
                            </li>
                            <li>
                                <p>登录地点：</p>
                                <input type="text" name="loginaddress"/>
                            </li>
                            <li>
                                <p>登录IP：</p>
                                <input type="text" name="loginip"/>
                            </li>
                            <li class="select-time">
                                <p>日期：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
                            </li>
                            <li>
                                <p>操作：</p>
                                <input type="text" name="operation"/>
                            </li>
                            <li>
                                <p>null：</p>
                                <input type="text" name="userpw"/>
                            </li>
                            <li>
                                <p>null：</p>
                                <select name="utype" th:with="type=${@dict.getType('')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="yf:usermanager:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="yf:usermanager:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="yf:usermanager:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="yf:usermanager:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('yf:usermanager:edit')}]];
        var removeFlag = [[${@permission.hasPermi('yf:usermanager:remove')}]];
        var prefix = ctx + "yf/usermanager";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "用户信息",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'userid', 
                    title : '编号',
                    visible: false
                },
                {
                    field : 'userrole', 
                    title : '用户角色'
                },
                {
                    field : 'username', 
                    title : '用户名'
                },
                {
                    field : 'useremail', 
                    title : 'Email'
                },
                {
                    field : 'userstauts', 
                    title : '状态'
                },
                {
                    field : 'usercount', 
                    title : '登录次数'
                },
                {
                    field : 'loginaddress', 
                    title : '登录地点'
                },
                {
                    field : 'loginip', 
                    title : '登录IP'
                },
                {
                    field : 'createdate', 
                    title : '日期'
                },
                {
                    field : 'operation', 
                    title : '操作'
                },
                {
                    field : 'userpw', 
                    title : 'null'
                },
                {
                    field : 'utype', 
                    title : 'null'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.userid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.userid + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>